/**
 * 
 */
package org.rollinitiative.d20.entity.talents;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

import org.rollinitiative.d20.entity.Ability;

/**
 * @author bebopjmm
 * 
 */
@XmlType(name = "SkillType", namespace = "java:org.rollinitiative.d20.entity")
public class Skill
{

   private  QName id  = new QName("NOT SET");

   private String name = "NOT SET";

   private Ability keyAbility;
   
   private boolean untrained;
   
   private int armorPenalty;


   /**
    * @return the id of the skill
    */
   public QName getId()
   {
      return id;
   }


   /**
    * @param id new ID attribute for the skill
    */
   @XmlAttribute(required = true)
   void setId(QName id)
   {
      this.id = id;
   }


   /**
    * @return the descriptive name of the skill
    */
   public String getName()
   {
      return name;
   }


   /**
    * @param name new name attribute for the skill
    */
   @XmlElement(name = "Name", required = true)
   void setName(String name)
   {
      this.name = name;
   }


   /**
    * @return the keyAbility associated with this skill
    */
   public Ability getKeyAbility()
   {
      return keyAbility;
   }


   /**
    * @param keyAbility new keyAbility for this skill
    */
   @XmlElement(name = "KeyAbility", required = true)
   void setKeyAbility(Ability keyAbility)
   {
      this.keyAbility = keyAbility;
   }


   /**
    * @return the untrained
    */
   public boolean isUntrained()
   {
      return untrained;
   }


   /**
    * @param untrained the untrained to set
    */
   @XmlAttribute(required = true)
   public void setUntrained(boolean untrained)
   {
      this.untrained = untrained;
   }


   /**
    * @return the armorPenalty
    */
   public int getArmorPenalty()
   {
      return armorPenalty;
   }


   /**
    * @param armorPenalty the armorPenalty to set
    */
   @XmlAttribute(required = true)
   public void setArmorPenalty(int armorPenalty)
   {
      this.armorPenalty = armorPenalty;
   }


   /*
    * (non-Javadoc)
    * 
    * @see java.lang.Object#equals(java.lang.Object)
    */
   @Override
   public boolean equals(Object obj)
   {
      if (!(obj instanceof Skill)) {
         return false;
      }
      Skill target = (Skill) obj;
      if (this.id.equals(target.id)) {
         return true;
      }
      else {
         return false;
      }
   }

}
